var loginTrue = false;

$(function () {
    //前台学生登录
    $("#studentLogin").click(function () {
        zeroModal.show({
            title: '登 录',
            iframe: true,
            url: 'student/student_login.jsp',
            width: '40%',
            height: '60%',
            top: '10%',
            left: '25%',
            esc: true,
            overlay: true,
            onClosed: function () {
                location.reload();
            }
        });
    });


    //前台教师登录
    $("#teacherLogin").click(function () {
        zeroModal.show({
            title: '登录',
            iframe: true,
            url: 'teacher/teacher_login.jsp',
            width: '40%',
            height: '60%',
            top: '10%',
            left: '25%',
            esc: true,
            overlay: true,
            onClosed: function () {
                location.reload();
            }
        });
    });


    //前台管理员登录
    $("#adminLogin").click(function () {
        zeroModal.show({
            title: '登 录',
            iframe: true,
            url: 'admin/admin_login.jsp',
            width: '40%',
            height: '60%',
            top: '10%',
            left: '25%',
            esc: true,
            overlay: true,
            onClosed: function () {
                location.reload();
            }
        });
    });
});

function LoginValidate() {
    loginTrue = true;
    var studnetAccount = $("#inputEmail3").val();
    if (studnetAccount.trim() == "" || studnetAccount == null) {
        loginTrue = false;
        $("#studentAccountMsg").text("账号为空");
        return false;
    }
    var studentPwd = $("#inputPassword3").val();
    if (studentPwd == null || studentPwd.trim() == "") {
        loginTrue = false;
        $("#studentPwdMsg").text("密码为空");
        return false;
    }

    if (loginTrue) {
        zeroModal.closeAll();
        location.reload();
        return true;
    } else {
        alert("登录信息有误!");
        return false;
    }
}